/**
 * 表单首页显示
 * 
 * @date 2012-05-14
 */

$(function initIndex() {
//	$.blockUI({draggable: true,message:  '系统正在加载数据，请稍后.....',timeout:1000});
	loadTopMenuEvent();
});

function loadTopMenuEvent() {
  
	$("#topHead").show();//显示top 页面	
	$(".mmlMenu").click(
	  function() {
		  var obj = this;
		 $(".mmlMenu").each(function() {
			if ($(this).attr("id") == $(obj).attr("id")) {
				$("#" + this.id).css("background-image","url(./icons/menu_bg.jpg)");
				showMenuPage(this.id, $(this).text());
			} else
				$("#" + this.id).css("background-image", "");
		 });
	 });
  		
}

function showMenuPage(id, text) {
    
	if ($("#west").attr("SET_FOCUS") == id)
		return null;
	$("#west").attr("SET_FOCUS", id);
	$("#west").panel( {
		title : text
	});
	createMenu(leftMenu(id));
	
	return null;
}

function leftMenu(key) {
	var menus = {
		firstPage : [  ],
		sysPage : [ {
			text : "组织机构",
			children : [ {
				text : "本所信息",
				url : "form/sysManager/officeMsg.jsp",
				icon : ''
			},{
				text : "用户部门",
				url : "form/sysManager/userDepartment.jsp",
				icon : ''
			}, {
				text : "用户角色",
				url : "form/sysManager/userRole.jsp",
				icon : ''
			} ,{
				text : "本所员工",
				url : "form/sysManager/allStaff.jsp",
				icon : ''
			},{
				text : "本人信息",
				url : "form/sysManager/iInformation.jsp",
				icon : ''
			}]
		} ,
		{
			text : "系统配置",
			children : [ {
				text : "系统菜单",
				url : "form/sysManager/sysMenu.jsp",
				icon : ''
			}, {
				text : "系统参数",
				url : "form/sysManager/sysParam.jsp",
				icon : ''
			} , {
				text : "客户要求",
				url : "form/sysManager/custRequirement.jsp",
				icon : ''
			}, {
				text : "任务通知",
				url : "form/sysManager/taskInform.jsp",
				icon : ''
			}, {
				text : "费用配置",
				url : "form/sysManager/costAllocation.jsp",
				icon : ''
			}, {
				text : "模板文件",
				url : "form/sysManager/templateFile.jsp",
				icon : ''
			}, {
				text : "微生物保藏单位",
				url : "form/sysManager/microbialPservationUnit.jsp",
				icon : ''
			}, {
				text : "节假日",
				url : "form/sysManager/festivalHoliday.jsp",
				icon : ''
			}, {
				text : "国家地区",
				url : "form/sysManager/countriesAreas.jsp",
				icon : ''
			}, {
				text : "行政区划",
				url : "form/sysManager/administrativeDistricts.jsp",
				icon : ''
			}]
		} ],
		taskPage : [ {
			text : "通知",
			children : [ {
				text : "新建",
				url : "error.jsp",
				icon : ''
			}, {
				text : "查询",
				url : "error.jsp",
				icon : ''
			} , {
				text : "核销",
				url : "error.jsp",
				icon : ''
			}]
		},{
			text : "任务",
			children : [ {
				text : "新建",
				url : "error.jsp",
				icon : ''
			}, {
				text : "查询",
				url : "error.jsp",
				icon : ''
			} , {
				text : "核销",
				url : "error.jsp",
				icon : ''
			}]
		} ],
		msgPage : [ {
			text : "代理人工作量",
			children : [ {
				text : "年度完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "季度完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "月完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "完成工作类型",
				url : "error.jsp",
				icon : ''
			} ]
		}, {
			text : "案件量",
			children : [ {
				text : "年度完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "季度完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "月完成工作量",
				url : "error.jsp",
				icon : ''
			}, {
				text : "完成工作类型",
				url : "error.jsp",
				icon : ''
			} ]
		} ],
		clientPage : [ {
			text : "客户信息",
			children : [ {
				text : "客户基本信息",
				url : "form/customerManagement/customerList.jsp",
				icon : ''
			}, {
				text : "申请人",
				url : "form/customerManagement/applicantList.jsp",
				icon : ''
			} , {
				text : "发明人",
				url : "error.jsp",
				icon : ''
			}, {
				text : "联系人",
				url : "error.jsp",
				icon : ''
			}, {
				text : "客户要求",
				url : "error.jsp",
				icon : ''
			}, {
				text : "客户文件",
				url : "error.jsp",
				icon : ''
			}]
		} ],
		casePage : [ {
			text : "案件基本信息",
			children : [ {
				text : "案件信息",
				url : "error.jsp",
				icon : ''
			}, {
				text : "客户要求",
				url : "error.jsp",
				icon : ''
			}, {
				text : "申请人",
				url : "error.jsp",
				icon : ''
			} ]
		} , {
			text : "文件存档",
			children : [ {
				text : "提交文件存档",
				url : "error.jsp",
				icon : ''
			}, {
				text : "官文存档",
				url : "error.jsp",
				icon : ''
			} , {
				text : "致客户函存档",
				url : "error.jsp",
				icon : ''
			}]
		} , {
			text : "任务&通知",
			children : [ {
				text : "通知查询",
				url : "error.jsp",
				icon : ''
			}, {
				text : "任务查询",
				url : "error.jsp",
				icon : ''
			}, {
				text : "新建通知",
				url : "error.jsp",
				icon : ''
			}, {
				text : "新建任务",
				url : "error.jsp",
				icon : ''
			}, {
				text : "任务&通知核销",
				url : "error.jsp",
				icon : ''
			}]
		}, {
			text : "费用信息",
			children : [ {
				text : "费用情况查询",
				url : "error.jsp",
				icon : ''
			}, {
				text : "费用操单",
				url : "error.jsp",
				icon : ''
			}, {
				text : "官费缴纳",
				url : "error.jsp",
				icon : ''
			}, {
				text : "收款登记",
				url : "error.jsp",
				icon : ''
			}, {
				text : "支出费用",
				url : "error.jsp",
				icon : ''
			}, {
				text : "酬金管理",
				url : "error.jsp",
				icon : ''
			} ]
		}]
	}
	return menus[key];
}